{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "shellscript"
    }
   },
   "outputs": [],
   "source": [
    "# 安装\n",
    "apt install docker.io"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "shellscript"
    }
   },
   "outputs": [],
   "source": [
    "# 检查Docker工作状态\n",
    "systemctl status docker"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "root@hecs-271888:~# systemctl status docker\n",
    "Unit docker.service could not be found."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "日志排查错误"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "shellscript"
    }
   },
   "outputs": [],
   "source": [
    "root@hecs-271888:~# journalctl -u docker.service\n",
    "-- No entries --"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Docker Hub Config\n",
    "\n",
    "国内镜像源配置：\n",
    "\n",
    "创建Docker配置路径\n",
    "\n",
    "``` shell\n",
    "mkdir -p /etc/docker\n",
    "```\n",
    "\n",
    "创建配置文件\n",
    "\n",
    "``` shell\n",
    "vim /etc/docker/daemon.json \n",
    "```\n",
    "\n",
    "添加内容\n",
    "\n",
    "``` json\n",
    "{\n",
    "  \"registry-mirrors\": [\n",
    "    \"https://docker.linkedbus.com\",\n",
    "    \"https://docker.xuanyuan.me\"\n",
    "  ]\n",
    "}\n",
    "```\n",
    "\n",
    "重启Docker以生效配置\n",
    "\n",
    "``` shell\n",
    "systemctl daemon-reload\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
